function go5(){ 
    let c = document.getElementById('lesson5')
    let ctx = c.getContext('2d') 

    let index=0;
    function render(){
        ctx.clearRect(0,0,600,400);
        index++;
        if(index>40){index =0;}
        ctx.moveTo(50,50);
        ctx.lineTo(200,100);
        ctx.lineTo(350,50); 
        //设置线条样式,默认1px
        ctx.linewidth =1;
        //设置线条端点样式,butt平齐,round半圆,正方形:square
        ctx.lineCap ="square"
        //设置折线段v型交接处的样式,mitter尖角,round圆角,bevel平角
        ctx.lineJoin ="mitter"
        //设置折线段v型交接处, 如果 ctx.lineJoin ="mitter", 则超过ctx.miterLimit =5; 会变成平角
        ctx.miterLimit =5;
        // 设置虚线
        ctx.setLineDash([20,10]);
        ctx.lineDashOffset = index; //虚线的偏移
        ctx.stroke();
        requestAnimationFrame(render)
    }
    render()
} 